﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2006.ShoppingSite.Domain
{
    [Table("tb_spu")]
    public class SPUEntity : AuditField<long>
    {
        public Guid BrandId { get; set; }   //品牌
        public Guid CategoryId { get; set; }  //分类
        public string? Description { get; set; } //描述
        public string CoverImg { get; set; } = "default.jpg";//封面图
        public string? Title { get; set; } //标题
    }



    [Table("tb_category")]
    public class CategoryEntity : KeyField<Guid>
    {
        public Guid? PId { get; set; }
        public string? Name { get; set; }
        public string? Image { get; set; } = "default.jpg";
    }



    [Table("tb_brand")]
    public class BrandEntity : KeyField<Guid>
    {
        public string? Name { get; set; }
        public string? Logo { get; set; }
        public string? Description { get; set; }
    }




    [Table("tb_sku")]
    public class SKUEntity : AuditField<long>
    {
        public Guid SPUId { get; set; }

        //规格配置
        //"{"内存":32G,"颜色"："白色","尺寸":"4.6"}"
        //[{specid:specvalue},{specid:specvalue},{specid:specvalue},{specid:specvalue}]
        //public string? Configs { get; set; } 

        public int ColorId { get; set; } //颜色
        public int SizeId { get; set; } //尺寸
        public decimal SalePrice { get; set; }  //实际售价
        public decimal MartetPrice { get; set; }  //市场标价

        public int Stock { get; set; } //库存
        public int UsableStock { get; set; } //可用库存
        public int LockStock { get; set; } //锁定库存
        public int MinStock { get; set; } //最少库存---预警库存
    }


    [Table("tb_spu_image")]
    public class SKUImageEntity : KeyField<int>
    {
        public long SKUID { get; set; }
        public string? ImgPath { get; set; }
        public string? Sort { get; set; }
    }


    [Table("tb_dictionary")]
    public class DictionaryEntity : KeyField<int>
    {
        public string? DictionaryType { get; set; }
        public string? DictionaryValue { get; set; }
        public string? Sort { get; set; }
    }
}
